﻿namespace HuaWei
{
    using DevExpress.Utils;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraEditors.Repository;
    using DevExpress.XtraGrid;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Views.Grid;
    using DevExpress.XtraTab;
    using DevExpress.XtraTreeList;
    using DevExpress.XtraTreeList.Columns;
    using HuaWei.CommClass;
    using HuaWei.Common;
    using HuaWei.DAI;
    using HuaWei.Windows.Forms;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Drawing.Drawing2D;
    using System.Text;
    using System.Windows.Forms;

    public class FrmBGSP : Form
    {
        private string _str;
        private BindingSource bindingSource;
        private BindingSource bindingSource1;
        private BindingSource bindingSource2;
        private SimpleButton btnSave;
        private ComboBoxEdit cboSPJT;
        private GridColumn colBL;
        private GridColumn colBQJLS;
        private TreeListColumn colCBMC;
        private GridColumn colDW;
        private TreeListColumn colID;
        private GridColumn colMC;
        private GridColumn colPZBH;
        private GridColumn colQDBH;
        private GridColumn colQDMC1;
        private GridColumn colQQZH;
        private GridColumn colSL;
        private GridColumn colSPZT;
        private DataSet dataSet = new DataSet();
        private ButtonEdit edtQDBH;
        private GridControl grdSPQK;
        private GridControl gridControl;
        private GridView gridView1;
        private GridView gridView2;
        private GroupControl groupControl1;
        private IContainer icontainer = null;
        private LabelControl labelControl1;
        private LabelControl labelControl2;
        private LabelControl labelControl3;
        private LabelControl labelControl5;
        private TextEdit onypCxUys;
        private PanelControl panelControl2;
        private PanelControl panelControl3;
        private PanelControl panelControl4;
        private PanelControl panelControl5;
        private RadioGroup radioGroup;
        private RepositoryItemComboBox repositoryItemComboBox1;
        private RepositoryItemImageComboBox repositoryItemImageComboBox2;
        private RepositoryItemLookUpEdit repositoryItemLookUpEdit1;
        private SimpleButton simpleButton;
        private SplitterControl splitterControl1;
        private TextEdit textEdit1;
        private TextEdit textEdit2;
        private TreeList trJLQD;

        public FrmBGSP()
        {
            this.InitializeComponent();
        }

        private void bindingSource_PositionChanged(object sender, EventArgs e)
        {
            this.method11();
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            this.method6();
        }

        private void cboSPJT_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.method7(this.cboSPJT.SelectedIndex);
        }

        protected override void DefWndProc(ref Message m)
        {
            switch (m.Msg)
            {
                case 0x60:
                    this.method(GParams.QCInfo);
                    break;

                case 0x61:
                    this.method6();
                    break;

                case 0x62:
                    this.method(GParams.QCInfo);
                    break;

                default:
                    base.DefWndProc(ref m);
                    break;
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.icontainer != null))
            {
                this.icontainer.Dispose();
            }
            base.Dispose(disposing);
        }

        private void edtQDBH_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            this.edtQDBH.Text = "";
            this.method9("");
        }

        private void FrmBGSP_Load(object sender, EventArgs e)
        {
            this._str = GParams.QCInfo.QCID;
            this.method2();
            this.method3(GParams.QCInfo.QCID);
        }

        private void gridControl_DoubleClick(object sender, EventArgs e)
        {
        }

        private void gridView2_RowStyle(object sender, RowStyleEventArgs e)
        {
            new AppearanceDefault(Color.Black, Color.Salmon, Color.Empty, Color.SeaShell, LinearGradientMode.Horizontal);
            this.gridView2.GetDataRow(e.RowHandle);
        }

        private void InitializeComponent()
        {
            this.icontainer = new Container();
            this.groupControl1 = new GroupControl();
            this.trJLQD = new TreeList();
            this.colCBMC = new TreeListColumn();
            this.colID = new TreeListColumn();
            this.bindingSource1 = new BindingSource(this.icontainer);
            this.repositoryItemImageComboBox2 = new RepositoryItemImageComboBox();
            this.radioGroup = new RadioGroup();
            this.panelControl4 = new PanelControl();
            this.gridControl = new GridControl();
            this.bindingSource = new BindingSource(this.icontainer);
            this.gridView2 = new GridView();
            this.colPZBH = new GridColumn();
            this.colQQZH = new GridColumn();
            this.colQDBH = new GridColumn();
            this.colQDMC1 = new GridColumn();
            this.colDW = new GridColumn();
            this.colBQJLS = new GridColumn();
            this.repositoryItemLookUpEdit1 = new RepositoryItemLookUpEdit();
            this.colSPZT = new GridColumn();
            this.repositoryItemComboBox1 = new RepositoryItemComboBox();
            this.panelControl5 = new PanelControl();
            this.simpleButton = new SimpleButton();
            this.labelControl5 = new LabelControl();
            this.edtQDBH = new ButtonEdit();
            this.cboSPJT = new ComboBoxEdit();
            this.btnSave = new SimpleButton();
            this.panelControl3 = new PanelControl();
            this.grdSPQK = new GridControl();
            this.bindingSource2 = new BindingSource(this.icontainer);
            this.gridView1 = new GridView();
            this.colMC = new GridColumn();
            this.colSL = new GridColumn();
            this.colBL = new GridColumn();
            this.panelControl2 = new PanelControl();
            this.labelControl3 = new LabelControl();
            this.labelControl2 = new LabelControl();
            this.onypCxUys = new TextEdit();
            this.textEdit2 = new TextEdit();
            this.textEdit1 = new TextEdit();
            this.labelControl1 = new LabelControl();
            this.splitterControl1 = new SplitterControl();
            this.groupControl1.BeginInit();
            this.groupControl1.SuspendLayout();
            this.trJLQD.BeginInit();
            ((ISupportInitialize) this.bindingSource1).BeginInit();
            this.repositoryItemImageComboBox2.BeginInit();
            this.radioGroup.Properties.BeginInit();
            this.panelControl4.BeginInit();
            this.panelControl4.SuspendLayout();
            this.gridControl.BeginInit();
            ((ISupportInitialize) this.bindingSource).BeginInit();
            this.gridView2.BeginInit();
            this.repositoryItemLookUpEdit1.BeginInit();
            this.repositoryItemComboBox1.BeginInit();
            this.panelControl5.BeginInit();
            this.panelControl5.SuspendLayout();
            this.edtQDBH.Properties.BeginInit();
            this.cboSPJT.Properties.BeginInit();
            this.panelControl3.BeginInit();
            this.panelControl3.SuspendLayout();
            this.grdSPQK.BeginInit();
            ((ISupportInitialize) this.bindingSource2).BeginInit();
            this.gridView1.BeginInit();
            this.panelControl2.BeginInit();
            this.panelControl2.SuspendLayout();
            this.onypCxUys.Properties.BeginInit();
            this.textEdit2.Properties.BeginInit();
            this.textEdit1.Properties.BeginInit();
            base.SuspendLayout();
            this.groupControl1.Controls.Add(this.trJLQD);
            this.groupControl1.Controls.Add(this.radioGroup);
            this.groupControl1.Dock = DockStyle.Left;
            this.groupControl1.Location = new Point(0, 0);
            this.groupControl1.Name = "groupControl1";
            this.groupControl1.Size = new Size(0xa2, 0x22b);
            this.groupControl1.TabIndex = 10;
            this.groupControl1.Text = "计量清单信息";
            this.trJLQD.Columns.AddRange(new TreeListColumn[] { this.colCBMC, this.colID });
            this.trJLQD.DataSource = this.bindingSource1;
            this.trJLQD.Dock = DockStyle.Fill;
            this.trJLQD.ImageIndexFieldName = "QDLX";
            this.trJLQD.Location = new Point(2, 0x38);
            this.trJLQD.Name = "trJLQD";
            this.trJLQD.OptionsBehavior.Editable = false;
            this.trJLQD.ParentFieldName = "PID";
            this.trJLQD.PreviewFieldName = "QDMC";
            this.trJLQD.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemImageComboBox2 });
            this.trJLQD.Size = new Size(0x9e, 0x1f1);
            this.trJLQD.TabIndex = 0;
            this.trJLQD.TreeLineStyle = LineStyle.None;
            this.trJLQD.DoubleClick += new EventHandler(this.trJLQD_DoubleClick);
            this.colCBMC.FieldName = "QDMC";
            this.colCBMC.Name = "colCBMC";
            this.colCBMC.Visible = true;
            this.colCBMC.VisibleIndex = 0;
            this.colCBMC.Width = 0xc0;
            this.colID.FieldName = "ID";
            this.colID.Name = "colID";
            this.bindingSource1.DataMember = "JLQD";
            this.repositoryItemImageComboBox2.AutoHeight = false;
            this.repositoryItemImageComboBox2.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repositoryItemImageComboBox2.Items.AddRange(new ImageComboBoxItem[] { new ImageComboBoxItem("", "1", 1), new ImageComboBoxItem("", "2", 5), new ImageComboBoxItem("", "3", 11) });
            this.repositoryItemImageComboBox2.Name = "repositoryItemImageComboBox2";
            this.radioGroup.Dock = DockStyle.Top;
            this.radioGroup.Location = new Point(2, 0x17);
            this.radioGroup.Name = "radQDSelc";
            this.radioGroup.Properties.Columns = 2;
            this.radioGroup.Properties.Items.AddRange(new RadioGroupItem[] { new RadioGroupItem(null, "本期清单"), new RadioGroupItem(null, "全部清单") });
            this.radioGroup.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.radioGroup.Size = new Size(0x9e, 0x21);
            this.radioGroup.TabIndex = 1;
            this.radioGroup.SelectedIndexChanged += new EventHandler(this.radioGroup_SelectedIndexChanged);
            this.panelControl4.Controls.Add(this.gridControl);
            this.panelControl4.Controls.Add(this.panelControl5);
            this.panelControl4.Controls.Add(this.panelControl3);
            this.panelControl4.Dock = DockStyle.Fill;
            this.panelControl4.Location = new Point(0xa8, 0);
            this.panelControl4.Name = "panelControl4";
            this.panelControl4.Size = new Size(0x39c, 0x22b);
            this.panelControl4.TabIndex = 13;
            this.gridControl.DataMember = null;
            this.gridControl.DataSource = this.bindingSource;
            this.gridControl.Dock = DockStyle.Fill;
            this.gridControl.EmbeddedNavigator.Buttons.Edit.Visible = false;
            this.gridControl.Location = new Point(2, 0x1b);
            this.gridControl.MainView = this.gridView2;
            this.gridControl.Name = "grdQDList";
            this.gridControl.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemComboBox1, this.repositoryItemLookUpEdit1 });
            this.gridControl.Size = new Size(730, 0x20e);
            this.gridControl.TabIndex = 14;
            this.gridControl.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.gridView2 });
            this.gridControl.DoubleClick += new EventHandler(this.gridControl_DoubleClick);
            this.bindingSource.DataMember = "JLSP_V";
            this.bindingSource.PositionChanged += new EventHandler(this.bindingSource_PositionChanged);
            this.gridView2.Columns.AddRange(new GridColumn[] { this.colPZBH, this.colQQZH, this.colQDBH, this.colQDMC1, this.colDW, this.colBQJLS, this.colSPZT });
            this.gridView2.GridControl = this.gridControl;
            this.gridView2.Name = "gridView2";
            this.gridView2.OptionsCustomization.AllowFilter = false;
            this.gridView2.OptionsCustomization.AllowGroup = false;
            this.gridView2.OptionsCustomization.AllowSort = false;
            this.gridView2.OptionsNavigation.EnterMoveNextColumn = true;
            this.gridView2.OptionsView.ColumnAutoWidth = false;
            this.gridView2.OptionsView.ShowGroupPanel = false;
            this.gridView2.RowStyle += new RowStyleEventHandler(this.gridView2_RowStyle);
            this.colPZBH.Caption = "凭证号";
            this.colPZBH.FieldName = "PZBH";
            this.colPZBH.Name = "colPZBH";
            this.colPZBH.OptionsColumn.AllowEdit = false;
            this.colPZBH.Visible = true;
            this.colPZBH.VisibleIndex = 0;
            this.colPZBH.Width = 0x47;
            this.colQQZH.Caption = "桩号";
            this.colQQZH.FieldName = "QQZH";
            this.colQQZH.Name = "colQQZH";
            this.colQQZH.OptionsColumn.AllowEdit = false;
            this.colQQZH.Visible = true;
            this.colQQZH.VisibleIndex = 1;
            this.colQQZH.Width = 0xa2;
            this.colQDBH.Caption = "清单编号";
            this.colQDBH.FieldName = "QDBH";
            this.colQDBH.Name = "colQDBH";
            this.colQDBH.OptionsColumn.AllowEdit = false;
            this.colQDBH.Visible = true;
            this.colQDBH.VisibleIndex = 2;
            this.colQDBH.Width = 0x51;
            this.colQDMC1.Caption = "清单名称";
            this.colQDMC1.FieldName = "QDMC";
            this.colQDMC1.Name = "colQDMC1";
            this.colQDMC1.OptionsColumn.AllowEdit = false;
            this.colQDMC1.Visible = true;
            this.colQDMC1.VisibleIndex = 3;
            this.colQDMC1.Width = 0xdb;
            this.colDW.Caption = "单位";
            this.colDW.FieldName = "DW";
            this.colDW.Name = "colDW";
            this.colDW.OptionsColumn.AllowEdit = false;
            this.colDW.Visible = true;
            this.colDW.VisibleIndex = 4;
            this.colDW.Width = 40;
            this.colBQJLS.Caption = "承包人";
            this.colBQJLS.FieldName = "BQJLS";
            this.colBQJLS.Name = "colBQJLS";
            this.colBQJLS.OptionsColumn.AllowEdit = false;
            this.colBQJLS.Visible = true;
            this.colBQJLS.VisibleIndex = 5;
            this.colBQJLS.Width = 0x30;
            this.repositoryItemLookUpEdit1.AutoHeight = false;
            this.repositoryItemLookUpEdit1.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repositoryItemLookUpEdit1.Columns.AddRange(new LookUpColumnInfo[] { new LookUpColumnInfo("code", "Name1", 20, FormatType.None, "", false, HorzAlignment.Default), new LookUpColumnInfo("value", 10, "Name2") });
            this.repositoryItemLookUpEdit1.Name = "repositoryItemLookUpEdit1";
            this.repositoryItemLookUpEdit1.PopupWidth = 20;
            this.repositoryItemLookUpEdit1.ShowHeader = false;
            this.colSPZT.Caption = "审批状态";
            this.colSPZT.ColumnEdit = this.repositoryItemLookUpEdit1;
            this.colSPZT.FieldName = "SPZT";
            this.colSPZT.Name = "colSPZT";
            this.colSPZT.Visible = true;
            this.colSPZT.VisibleIndex = 6;
            this.colSPZT.Width = 0x4d;
            this.repositoryItemComboBox1.AutoHeight = false;
            this.repositoryItemComboBox1.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repositoryItemComboBox1.Name = "repositoryItemComboBox1";
            this.panelControl5.Controls.Add(this.simpleButton);
            this.panelControl5.Controls.Add(this.labelControl5);
            this.panelControl5.Controls.Add(this.edtQDBH);
            this.panelControl5.Controls.Add(this.cboSPJT);
            this.panelControl5.Controls.Add(this.btnSave);
            this.panelControl5.Dock = DockStyle.Top;
            this.panelControl5.Location = new Point(2, 2);
            this.panelControl5.Name = "panelControl5";
            this.panelControl5.Size = new Size(730, 0x19);
            this.panelControl5.TabIndex = 0x15;
            this.simpleButton.Dock = DockStyle.Left;
            this.simpleButton.Location = new Point(0xd7, 2);
            this.simpleButton.Name = "btnFilterQD";
            this.simpleButton.Size = new Size(50, 0x15);
            this.simpleButton.TabIndex = 8;
            this.simpleButton.Text = "查询";
            this.simpleButton.Click += new EventHandler(this.simpleButton_Click);
            this.labelControl5.Anchor = AnchorStyles.Right | AnchorStyles.Top;
            this.labelControl5.Location = new Point(0x1f2, 6);
            this.labelControl5.Name = "labelControl5";
            this.labelControl5.Size = new Size(0x18, 14);
            this.labelControl5.TabIndex = 8;
            this.labelControl5.Text = "批复";
            this.edtQDBH.Dock = DockStyle.Left;
            this.edtQDBH.Location = new Point(2, 2);
            this.edtQDBH.Name = "edtQDBH";
            this.edtQDBH.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Close) });
            this.edtQDBH.Size = new Size(0xd5, 0x15);
            this.edtQDBH.TabIndex = 7;
            this.edtQDBH.ButtonClick += new ButtonPressedEventHandler(this.edtQDBH_ButtonClick);
            this.cboSPJT.Dock = DockStyle.Right;
            this.cboSPJT.Location = new Point(0x242, 2);
            this.cboSPJT.Name = "cboSPJT";
            this.cboSPJT.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.cboSPJT.Properties.Items.AddRange(new object[] { "通过", "退回", "结转下期" });
            this.cboSPJT.Size = new Size(100, 0x15);
            this.cboSPJT.TabIndex = 7;
            this.cboSPJT.SelectedIndexChanged += new EventHandler(this.cboSPJT_SelectedIndexChanged);
            this.btnSave.Dock = DockStyle.Right;
            this.btnSave.Location = new Point(0x2a6, 2);
            this.btnSave.Name = "btnSave";
            this.btnSave.Size = new Size(50, 0x15);
            this.btnSave.TabIndex = 0;
            this.btnSave.Text = "保存";
            this.btnSave.Click += new EventHandler(this.btnSave_Click);
            this.panelControl3.Controls.Add(this.grdSPQK);
            this.panelControl3.Controls.Add(this.panelControl2);
            this.panelControl3.Dock = DockStyle.Right;
            this.panelControl3.Location = new Point(0x2dc, 2);
            this.panelControl3.Name = "panelControl3";
            this.panelControl3.Size = new Size(190, 0x227);
            this.panelControl3.TabIndex = 13;
            this.grdSPQK.DataMember = null;
            this.grdSPQK.DataSource = this.bindingSource2;
            this.grdSPQK.Dock = DockStyle.Fill;
            this.grdSPQK.Location = new Point(2, 0x9d);
            this.grdSPQK.MainView = this.gridView1;
            this.grdSPQK.Name = "grdSPQK";
            this.grdSPQK.Size = new Size(0xba, 0x188);
            this.grdSPQK.TabIndex = 1;
            this.grdSPQK.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.gridView1 });
            this.bindingSource2.DataMember = "JLQD";
            this.gridView1.Columns.AddRange(new GridColumn[] { this.colMC, this.colSL, this.colBL });
            this.gridView1.GridControl = this.grdSPQK;
            this.gridView1.Name = "gridView1";
            this.gridView1.OptionsBehavior.ReadOnly = true;
            this.gridView1.OptionsView.ShowGroupPanel = false;
            this.gridView1.OptionsView.ShowIndicator = false;
            this.colMC.Caption = " ";
            this.colMC.FieldName = "MC";
            this.colMC.Name = "colMC";
            this.colMC.Visible = true;
            this.colMC.VisibleIndex = 0;
            this.colMC.Width = 0x59;
            this.colSL.Caption = "数量";
            this.colSL.FieldName = "SL";
            this.colSL.Name = "colSL";
            this.colSL.Visible = true;
            this.colSL.VisibleIndex = 1;
            this.colSL.Width = 0x2f;
            this.colBL.Caption = "占比";
            this.colBL.FieldName = "BL";
            this.colBL.Name = "colBL";
            this.colBL.Visible = true;
            this.colBL.VisibleIndex = 2;
            this.colBL.Width = 0x2e;
            this.panelControl2.Controls.Add(this.labelControl3);
            this.panelControl2.Controls.Add(this.labelControl2);
            this.panelControl2.Controls.Add(this.onypCxUys);
            this.panelControl2.Controls.Add(this.textEdit2);
            this.panelControl2.Controls.Add(this.textEdit1);
            this.panelControl2.Controls.Add(this.labelControl1);
            this.panelControl2.Dock = DockStyle.Top;
            this.panelControl2.Location = new Point(2, 2);
            this.panelControl2.Name = "panelControl2";
            this.panelControl2.Size = new Size(0xba, 0x9b);
            this.panelControl2.TabIndex = 2;
            this.labelControl3.Location = new Point(6, 0x6b);
            this.labelControl3.Name = "labelControl3";
            this.labelControl3.Size = new Size(0x48, 14);
            this.labelControl3.TabIndex = 5;
            this.labelControl3.Text = "交工证书编号";
            this.labelControl2.Location = new Point(6, 0x3e);
            this.labelControl2.Name = "labelControl2";
            this.labelControl2.Size = new Size(0x30, 14);
            this.labelControl2.TabIndex = 4;
            this.labelControl2.Text = "图纸编号";
            this.onypCxUys.DataBindings.Add(new Binding("EditValue", this.bindingSource, "ZJJGZSBH", true));
            this.onypCxUys.Location = new Point(6, 0x7c);
            this.onypCxUys.Name = "textEdit3";
            this.onypCxUys.Size = new Size(140, 0x15);
            this.onypCxUys.TabIndex = 3;
            this.textEdit2.DataBindings.Add(new Binding("EditValue", this.bindingSource, "TZBH", true));
            this.textEdit2.Location = new Point(6, 0x4f);
            this.textEdit2.Name = "textEdit2";
            this.textEdit2.Size = new Size(140, 0x15);
            this.textEdit2.TabIndex = 2;
            this.textEdit1.DataBindings.Add(new Binding("EditValue", this.bindingSource, "BW", true));
            this.textEdit1.Location = new Point(6, 0x22);
            this.textEdit1.Name = "textEdit1";
            this.textEdit1.Size = new Size(140, 0x15);
            this.textEdit1.TabIndex = 1;
            this.labelControl1.Location = new Point(6, 0x11);
            this.labelControl1.Name = "labelControl1";
            this.labelControl1.Size = new Size(0x18, 14);
            this.labelControl1.TabIndex = 0;
            this.labelControl1.Text = "部位";
            this.splitterControl1.Location = new Point(0xa2, 0);
            this.splitterControl1.Name = "splitterControl1";
            this.splitterControl1.Size = new Size(6, 0x22b);
            this.splitterControl1.TabIndex = 14;
            this.splitterControl1.TabStop = false;
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            base.ClientSize = new Size(0x444, 0x22b);
            base.Controls.Add(this.panelControl4);
            base.Controls.Add(this.splitterControl1);
            base.Controls.Add(this.groupControl1);
            base.Name = "FrmBGSP";
            this.Text = "变更审批";
            base.Load += new EventHandler(this.FrmBGSP_Load);
            this.groupControl1.EndInit();
            this.groupControl1.ResumeLayout(false);
            this.trJLQD.EndInit();
            ((ISupportInitialize) this.bindingSource1).EndInit();
            this.repositoryItemImageComboBox2.EndInit();
            this.radioGroup.Properties.EndInit();
            this.panelControl4.EndInit();
            this.panelControl4.ResumeLayout(false);
            this.gridControl.EndInit();
            ((ISupportInitialize) this.bindingSource).EndInit();
            this.gridView2.EndInit();
            this.repositoryItemLookUpEdit1.EndInit();
            this.repositoryItemComboBox1.EndInit();
            this.panelControl5.EndInit();
            this.panelControl5.ResumeLayout(false);
            this.panelControl5.PerformLayout();
            this.edtQDBH.Properties.EndInit();
            this.cboSPJT.Properties.EndInit();
            this.panelControl3.EndInit();
            this.panelControl3.ResumeLayout(false);
            this.grdSPQK.EndInit();
            ((ISupportInitialize) this.bindingSource2).EndInit();
            this.gridView1.EndInit();
            this.panelControl2.EndInit();
            this.panelControl2.ResumeLayout(false);
            this.panelControl2.PerformLayout();
            this.onypCxUys.Properties.EndInit();
            this.textEdit2.Properties.EndInit();
            this.textEdit1.Properties.EndInit();
            base.ResumeLayout(false);
        }

        private void method(QCInfo qcinfo)
        {
            this._str = qcinfo.QCID;
            DevCCHelp.ControlForm(base.Controls, qcinfo.QCZT == 3, 1);
            this.method5();
            this.method4();
            this.bindingSource.MoveFirst();
            this.method11();
        }

        private string method1(string _str1, string _str2, string _str3)
        {
            string str = "";
            StringBuilder builder = new StringBuilder();
            str = "select a.*,convert(decimal(10,0),a.sl/b.htsl*100) as BL from (";
            builder.Append(str);
            str = "select 1 as xh,qdid,'第'+ qcid + '期完成' as MC,sum(BQJLS) as SL from BGQDJL_MX \r\n                   where spzt=1 and xmid='#xmid#' and bdid='#bdid#'\r\n                   and qcid<'#qcid#'\r\n                   and qdid in (select qdid from BGQDJL_MX where qcid='#qcid#')\r\n                   group by qdid,qcid ";
            builder.Append(str);
            builder.Append(" union ");
            str = "select 2 as xh,qdid,'本期完成' as MC,sum(BQJLS) as SL from BGQDJL_MX \r\n                   where spzt=1 and xmid='#xmid#' and bdid='#bdid#'\r\n                   and qcid='#qcid#'\r\n                   and qdid in (select qdid from BGQDJL_MX where qcid='#qcid#')\r\n                   group by qdid,qcid ";
            builder.Append(str);
            builder.Append(" union ");
            str = "select 3 as xh,qdid,'本期末完成' as MC,sum(BQJLS) as SL from BGQDJL_MX \r\n                   where spzt=1 and xmid='#xmid#' and bdid='#bdid#'\r\n                   and qcid<='#qcid#'\r\n                   and qdid in (select qdid from BGQDJL_MX where qcid='#qcid#')\r\n                   group by qdid ";
            builder.Append(str);
            builder.Append(" union ");
            str = "select -1 as xh,id as qdid,'合同数量' as MC,htsl as SL from jlqd \r\n                   where xmid='#xmid#' and bdid='#bdid#'\r\n                   and id in (select qdid from BGQDJL_MX where qcid='#qcid#')";
            builder.Append(str);
            str = ") a left join jlqd b on a.qdid=b.id and b.xmid='#xmid#' and b.bdid='#bdid#'";
            builder.Append(str);
            return builder.ToString().Replace("#xmid#", _str1).Replace("#bdid#", _str2).Replace("#qcid#", _str3);
        }

        private void method10(object sender, TabPageChangedEventArgs e)
        {
        }

        private void method11()
        {
            string str = DHelp.GetObjValue(this.bindingSource, "qdid", false);
            this.bindingSource2.Filter = "qdid='" + str + "'";
        }

        private void method12(object sender, TabPageChangingEventArgs e)
        {
            this.method6();
        }

        private void method2()
        {
            DataTable table = new DataTable();
            table.Columns.Add("code", typeof(int));
            table.Columns.Add("value", typeof(string));
            DataRow row = table.NewRow();
            row["code"] = -1;
            row["value"] = "";
            table.Rows.Add(row);
            row = table.NewRow();
            row["code"] = 0;
            row["value"] = "通过";
            table.Rows.Add(row);
            row = table.NewRow();
            row["code"] = 1;
            row["value"] = "退回";
            table.Rows.Add(row);
            row = table.NewRow();
            row["code"] = 2;
            row["value"] = "结转下期";
            table.Rows.Add(row);
            RepositoryItemLookUpEdit columnEdit = (RepositoryItemLookUpEdit) this.colSPZT.ColumnEdit;
            columnEdit.DataSource = table;
            columnEdit.DisplayMember = "value";
            columnEdit.ValueMember = "code";
            RepositoryItemLookUpEdit edit2 = (RepositoryItemLookUpEdit) this.colSPZT.ColumnEdit;
            edit2.DataSource = table;
            edit2.DisplayMember = "value";
            edit2.ValueMember = "code";
        }

        private void method3(string _str1)
        {
            IDataAccess idataAccess = DBHelp.IniIDA();
            string str = "";
            string str2 = "";
            str = "select * from JLQD" + Class28.smethod1();
            if (_str1 != "")
            {
                str = CSQL.JLSPQCQD.Replace("#xmid#", GParams._XMID).Replace("#bdid#", GParams._BDID).Replace("#qcid#", _str1);
            }
            Class39.smethod4(idataAccess, this.dataSet, str, "JLQD", true);
            this.bindingSource1.DataSource = this.dataSet.Tables["JLQD"];
            str = "select * from " + CSQL.BGSP_V + Class28.smethod1();
            str2 = " and qcid='" + _str1 + "'";
            this.dataSet.Merge(idataAccess.ExecuteDataSet(str + str2, CommandType.Text, "BGQDJL_MX"));
            this.bindingSource.DataSource = this.dataSet.Tables["BGQDJL_MX"];
            str = this.method1(GParams._XMID, GParams._BDID, GParams.QCInfo.QCID);
            Class39.smethod4(idataAccess, this.dataSet, str, "SPQK", true);
            this.bindingSource2.DataSource = this.dataSet.Tables["SPQK"];
            this.bindingSource2.Sort = "xh";
            idataAccess.CloseDatabase();
        }

        private void method4()
        {
            string str = "";
            IDataAccess idataAccess = DBHelp.IniIDA();
            string str2 = " and qcid='" + this._str + "'";
            this.dataSet.Tables["BGQDJL_MX"].Clear();
            this.dataSet.Tables["SPQK"].Clear();
            this.dataSet.Merge(idataAccess.ExecuteDataSet("select * from " + CSQL.BGSP_V + Class28.smethod1() + str2, CommandType.Text, "BGQDJL_MX"));
            this.bindingSource.DataSource = this.dataSet.Tables["BGQDJL_MX"];
            str = this.method1(GParams._XMID, GParams._BDID, this._str);
            Class39.smethod4(idataAccess, this.dataSet, str, "SPQK", true);
            this.bindingSource2.DataSource = this.dataSet.Tables["SPQK"];
            idataAccess.CloseDatabase();
        }

        private void method5()
        {
            IDataAccess access = DBHelp.IniIDA();
            this.dataSet.Tables["JLQD"].Clear();
            string str = "";
            string str2 = "";
            str = "select * from JLQD" + Class28.smethod1();
            if (this.radioGroup.SelectedIndex == 0)
            {
                str = CSQL.BGSPQCQD.Replace("#xmid#", GParams._XMID).Replace("#bdid#", GParams._BDID).Replace("#qcid#", this._str);
            }
            this.dataSet.Merge(access.ExecuteDataSet(str + str2, CommandType.Text, "JLQD"));
            access.CloseDatabase();
        }

        private void method6()
        {
            if (this.dataSet.HasChanges())
            {
                DataSet changes = this.dataSet.GetChanges();
                IDataAccess access = DBHelp.IniIDA();
                access.OpenDatabase();
                access.BeginTrans();
                try
                {
                    access.Update(changes, "BGQDJL_MX");
                    access.Commit();
                    this.method4();
                    MsgBox.ShowMsg("数据已成功保存！");
                    this.method3(GParams.QCInfo.QCID);
                }
                catch (Exception exception)
                {
                    access.RollBack();
                    MsgBox.ShowError("保存数据出错，请与管理员系统！", exception);
                }
                finally
                {
                    access.CloseDatabase();
                }
            }
        }

        private void method7(int numD)
        {
            foreach (DataRowView view2 in DHelp.GetDataView(this.bindingSource))
            {
                switch (GParams._JGLX)
                {
                    case JGLX.YZ:
                        view2.Row["YZSPZT"] = numD;
                        break;

                    case JGLX.JL:
                        view2.Row["JLSPZT"] = numD;
                        break;
                }
                view2.Row.EndEdit();
            }
        }

        private void method8(object sender, EventArgs e)
        {
            base.Close();
        }

        private void method9(string _str1)
        {
            if (_str1 != "")
            {
                this.bindingSource.Filter = "qdmc='" + _str1 + "'";
            }
            else
            {
                this.bindingSource.RemoveFilter();
            }
            this.bindingSource.MoveFirst();
            this.method11();
        }

        private void radioGroup_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.method5();
        }

        private void simpleButton_Click(object sender, EventArgs e)
        {
            this.method9(this.edtQDBH.Text);
        }

        private void trJLQD_DoubleClick(object sender, EventArgs e)
        {
            if (!this.trJLQD.FocusedNode.HasChildren)
            {
                string str = DHelp.GetObjValue(this.bindingSource1, "QDMC", false);
                this.edtQDBH.Text = str;
                this.method9(str);
            }
        }
    }
}

